package com.zxjia.ssmp.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zxjia.ssmp.dto.CartRequest;
import com.zxjia.ssmp.entity.Cart;
import com.zxjia.ssmp.mapper.CartMapper;
import com.zxjia.ssmp.service.CartService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

@Service
public class CartServiceImpl extends ServiceImpl<CartMapper, Cart> implements CartService {

    @Override
    public boolean addCart(CartRequest request) {
        Cart cart = new Cart();
        BeanUtils.copyProperties(request, cart);
        return this.save(cart);
    }
}
